package com.thinkgsp.jxc.model;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


/***
 * 盘点单
 * @author evan
 *
 */
public class CheckBill extends BaseModel {

	private static final long serialVersionUID = 5195404200629365305L;

	private Long billId;
	private Date billDate = new Date(System.currentTimeMillis());
	private Integer deptId;
	private Integer empId;
	private Integer invAddId;
	private Integer status;
	private Integer fyear;
	private Integer period;
	private Boolean archived = false;
	private String remark;
	private Long jxcBillId;
	private BigDecimal lossOfAmount; //盘损金额
	
	private Dept dept;
	private Emp emp;
	private InventoryAdd invAdd;
	private List<CheckBillDetail> details = new ArrayList<CheckBillDetail>();
	
	
	/**
	 * @return the invAdd
	 */
	public InventoryAdd getInvAdd() {
		return invAdd;
	}

	/**
	 * @param invAdd the invAdd to set
	 */
	public void setInvAdd(InventoryAdd invAdd) {
		this.invAdd = invAdd;
	}

	/**
	 * @return the dept
	 */
	public Dept getDept() {
		return dept;
	}

	/**
	 * @param dept the dept to set
	 */
	public void setDept(Dept dept) {
		this.dept = dept;
	}

	/**
	 * @return the emp
	 */
	public Emp getEmp() {
		return emp;
	}

	/**
	 * @param emp the emp to set
	 */
	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	/**
	 * @return the details
	 */
	public List<CheckBillDetail> getDetails() {
		return details;
	}

	/**
	 * @param details the details to set
	 */
	public void setDetails(List<CheckBillDetail> details) {
		this.details = details;
	}

	/**
	 * @return the billId
	 */
	public Long getBillId() {
		return billId;
	}

	/**
	 * @param billId the billId to set
	 */
	public void setBillId(Long billId) {
		this.billId = billId;
	}

	/**
	 * @return the billDate
	 */
	public Date getBillDate() {
		return billDate;
	}

	/**
	 * @param billDate the billDate to set
	 */
	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}

	/**
	 * @return the deptId
	 */
	public Integer getDeptId() {
		return deptId;
	}

	/**
	 * @param deptId the deptId to set
	 */
	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	/**
	 * @return the empId
	 */
	public Integer getEmpId() {
		return empId;
	}

	/**
	 * @param empId the empId to set
	 */
	public void setEmpId(Integer empId) {
		this.empId = empId;
	}

	/**
	 * @return the invAddId
	 */
	public Integer getInvAddId() {
		return invAddId;
	}

	/**
	 * @param invAddId the invAddId to set
	 */
	public void setInvAddId(Integer invAddId) {
		this.invAddId = invAddId;
	}

	/**
	 * @return the status
	 */
	public Integer getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}

	/**
	 * @return the fyear
	 */
	public Integer getFyear() {
		return fyear;
	}

	/**
	 * @param fyear the fyear to set
	 */
	public void setFyear(Integer fyear) {
		this.fyear = fyear;
	}

	/**
	 * @return the period
	 */
	public Integer getPeriod() {
		return period;
	}

	/**
	 * @param period the period to set
	 */
	public void setPeriod(Integer period) {
		this.period = period;
	}

	/**
	 * @return the archived
	 */
	public Boolean getArchived() {
		return archived;
	}

	/**
	 * @param archived the archived to set
	 */
	public void setArchived(Boolean archived) {
		this.archived = archived;
	}

	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		sb.append("billId",this.billId);
		
		return sb.toString();
	}

	@Override
	public boolean equals(Object o) {
		if(this == o) {
			return true;
		}
		if(!(o instanceof CheckBill)) {
			return false;
		}
		final CheckBill bill = (CheckBill)o;
		if(billId != null) {
			return billId.equals(bill.getBillId());
		} else {
			return bill.getBillId() == null;
		}
	}

	@Override
	public int hashCode() {
		return (this.billId != null ? this.billId.hashCode() : 0);
	}

	public Long getJxcBillId() {
		return jxcBillId;
	}

	public void setJxcBillId(Long jxcBillId) {
		this.jxcBillId = jxcBillId;
	}

	public BigDecimal getLossOfAmount() {
		return lossOfAmount;
	}

	public void setLossOfAmount(BigDecimal lossOfAmount) {
		this.lossOfAmount = lossOfAmount;
	}

}
